package uhasselt.ontologyplugin;

import net.sf.saxon.s9api.XdmNode;
import uhasselt.ontologyplugin.IdentityTransformer;
import net.sf.saxon.s9api.Processor;
public abstract class ToSkosTransformer{
	
	
		private static Processor _processor = null;
		
		public static Processor getProcessorInstance(){
			if(_processor == null)
				_processor = new Processor(false);
			return _processor;
		}
	/**
	 * @param document A `document' that has to be transformed into RDF/XML (SKOS)
	 * @return Skos representation in RDF/XML
	 */
	public abstract XdmNode transform(String document);
	
	
	public abstract void initialise(PropertyReader reader,String propertyPrefix);
	
	
	public XdmNode getEmptrySkosDocument(){
		String temp = "<?xml version=\"1.0\" encoding=\"utf-8\"?> "+
		     "<rdf:RDF"+
			 " xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\""+
		     " xmlns:skos=\"http://www.w3.org/2004/02/skos/core#\""+
		      	" xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\""+
		      	" xmlns:dc=\"http://purl.org/dc/elements/1.1/\""+
		     	" xmlns:dcterms=\"http://purl.org/dc/terms/\""+
		     	" xmlns:foaf=\"http://xmlns.com/foaf/0.1/\""+
		      	" xmlns:aos=\"http://aims.fao.org/aos/common/\"/>";
		   IdentityTransformer id = new IdentityTransformer();
		return id.transform(temp);
	}
}